package com.shanzhi.dify.service;

import com.shanzhi.connection.common.HttpRequestType;
import com.shanzhi.dify.common.DifyUrlEnums;

import java.util.Map;

public interface DifyBaseService {


    /**
     * 获取真实的Dify接口地址
     *
     * @param difyUrlEnums
     * @return
     */
    String getRealUrl(DifyUrlEnums difyUrlEnums, Object... pathParams);

    String buildUrl(DifyUrlEnums urlEnum, Object... pathParams);

    /**
     * 发送Dify请求
     * 如果apikey为空，使用dify的默认apikey,即知识库apikey
     *
     * @param entity
     * @param apiKey
     * @param urlEnum
     * @return
     */
    String sendDifyRequest(Object entity, String apiKey, DifyUrlEnums urlEnum, HttpRequestType httpRequestType, Map<String, Object> params, Object... pathParams);

    String resolveApiKey(String apiKey);
}
